package Readers;

import java.util.Arrays;
import java.util.List;

import NWPackage.Calculations;
import NWPackage.ProbabilityCell;
import NWPackage.RealVoteCell;

public class StaticInputs3cands extends Inputs {
	
	private final String[] candidates = {"A","B","C"};
	private List<String> dynamicCandidates = Arrays.asList(candidates);
	private final int numCandidates = candidates.length;
	
	private final String[] agents = {"V1", "V2"};
	private final int numAgents = agents.length;
	private ProbabilityCell[] allprobabilities=null;
	
	//{A,B,C} = A<B<C
	private String[][] preferrences = {{"A","B","C"},{"A","C","B"},{"B","A","C"},{"B","C","A"},{"C","A","B"},{"C","B","A"}};
	
	private final int MonteCarloRandomProcess = 2;
	
	//private final int BORDA_MIN_VALUE = 1;
	private final int BORDA_MAX_VALUE = numCandidates;
	//private final int RANDOM_SEED = 19830912;
	private final int HURISTIC = 1;
	
	

	public ProbabilityCell[] matrixProbabilities() {
		allprobabilities = new ProbabilityCell[numAgents*Calculations.calcCandidatesPermutationsNPR(numCandidates)];
		
		
		allprobabilities[0] = new ProbabilityCell("V1", 0.1,Arrays.asList(preferrences[0]));
		allprobabilities[1] = new ProbabilityCell("V1", 0.4,Arrays.asList(preferrences[1]));
		allprobabilities[2] = new ProbabilityCell("V1", 0.1,Arrays.asList(preferrences[2]));
		allprobabilities[3] = new ProbabilityCell("V1", 0.2,Arrays.asList(preferrences[3]));
		allprobabilities[4] = new ProbabilityCell("V1", 0.1,Arrays.asList(preferrences[4]));
		allprobabilities[5] = new ProbabilityCell("V1", 0.1,Arrays.asList(preferrences[5]));
		
		allprobabilities[6] = new ProbabilityCell("V2", 0.1,Arrays.asList(preferrences[0]));
		allprobabilities[7] = new ProbabilityCell("V2", 0.4,Arrays.asList(preferrences[1]));
		allprobabilities[8] = new ProbabilityCell("V2", 0.1,Arrays.asList(preferrences[2]));
		allprobabilities[9] = new ProbabilityCell("V2", 0.1,Arrays.asList(preferrences[3]));
		allprobabilities[10] = new ProbabilityCell("V2", 0.1,Arrays.asList(preferrences[4]));
		allprobabilities[11] = new ProbabilityCell("V2", 0.2,Arrays.asList(preferrences[5]));
	/*	
		allprobabilities[12] = new ProbabilityCell("V3", 0.1,Arrays.asList(preferrences[0]));
		allprobabilities[13] = new ProbabilityCell("V3", 0.1,Arrays.asList(preferrences[1]));
		allprobabilities[14] = new ProbabilityCell("V3", 0.1,Arrays.asList(preferrences[2]));
		allprobabilities[15] = new ProbabilityCell("V3", 0.1,Arrays.asList(preferrences[3]));
		allprobabilities[16] = new ProbabilityCell("V3", 0.3,Arrays.asList(preferrences[4]));
		allprobabilities[17] = new ProbabilityCell("V3", 0.3,Arrays.asList(preferrences[5]));
	*/		
		/*allprobabilities[18] = new ProbabilityCell("V4", 0.05,Arrays.asList(preferrences[0]));
		allprobabilities[19] = new ProbabilityCell("V4", 0.05,Arrays.asList(preferrences[1]));
		allprobabilities[20] = new ProbabilityCell("V4", 0.4,Arrays.asList(preferrences[2]));
		allprobabilities[21] = new ProbabilityCell("V4", 0.3,Arrays.asList(preferrences[3]));
		allprobabilities[22] = new ProbabilityCell("V4", 0.1,Arrays.asList(preferrences[4]));
		allprobabilities[23] = new ProbabilityCell("V4", 0.1,Arrays.asList(preferrences[5]));
		*/
		return allprobabilities;
	}

	public RealVoteCell[] realVotesMatrix() {

		RealVoteCell[] allRealVotes = new RealVoteCell[numAgents];
		
		allRealVotes[0] = new RealVoteCell("V1",0,Arrays.asList(preferrences[1]));
		allRealVotes[1] = new RealVoteCell("V2",1,Arrays.asList(preferrences[1]));
		//allRealVotes[2] = new RealVoteCell("V3",2,Arrays.asList(preferrences[5]));
		//allRealVotes[3] = new RealVoteCell("V4",3,Arrays.asList(preferrences[2]));
		return allRealVotes;
	}
	public String[] getCandidates() {
		return this.candidates;
	}

	public List<String> getDynamicCandidates() {
		return this.dynamicCandidates;
	}

	public int getNumCandidates() {
		return this.numCandidates;
	}

	public String[] getAgents() {
		return this.agents;
	}

	public int getNumAgents() {
		return this.numAgents;
	}

	public int getMonteCarloRandomProcess() {
		return this.MonteCarloRandomProcess;
	}
	public int getBordaMaxValue() {
		return this.BORDA_MAX_VALUE;
	}

	public int getBordaMinValue() {
		return this.BORDA_MIN_VALUE;
	}

	@Override
	public ProbabilityCell[] getMatrixProbabilities() {
		if (this.allprobabilities == null)
			matrixProbabilities();
		return allprobabilities;
	}

	@Override
	public String getFileName() {
		return "StaticInputs3cands";
	}

	@Override
	public int getHuristic() {
		return HURISTIC;
	}
}
